#!/usr/bin/php -q
<?php
// Include Creovel Base.
require_once('base');

// Genrate routine.

switch (true) {
    // create schema
    case $args[0] == 'schema':
        __create_schema($params, $flags);
        break;
}


/**
 * Create DB schema routine.
 *
 * @return void
 **/
function __create_schema($params, $flags = null)
{
    if (!empty($params['model'])) {
        $params['class_name'] = $params['model']; 
    }
    @$options = array(
        'class_name'    => $params['class_name'],
        'table_name'    => $params['table_name'],
        'file'          => $params['file']
        );
    if ($file = DatabaseFile::create($options)) {
        echo "Schema created ({$file})!\n";
    }
}